package com.cz.nongyetongv5.bean;

import java.io.Serializable;
import java.util.Currency;

import android.util.Log;

import com.cz.nongyetongv5.utils.CharsetUtil;

/**
 * 被检单位
 */
public class BeiJianDanWei implements Serializable {

	private String id = null;

	private String name;
	private String d;
	private String code = null;
	private String regionName;

	public String getRegionName() {
		return regionName;
	}

	public void setRegionName(String regionName) {
		this.regionName = regionName;
	}

	private String addTime;

	private String modifyTime;

	private String deleteTime;

	private String address;

	private int kind;

	/**
	 * 精度
	 */
	private Double longitude;

	/**
	 * 维度
	 */
	private Double latitude;

	private String category;

	private String charge;

	private String tel;

	private String mobile;

	/**
	 * 是否创建受检单位
	 */
	private boolean isCreateShouJianDanWei = true;

	// 是否是红色数据 1 为红色0 为黄色
	private int isRedData;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public BeiJianDanWei(String id, String name) {
		this.id = id;
		this.name = name;
	}

	public BeiJianDanWei(String id, String name, String code) {
		this.id = id;
		this.name = name;
		this.code = code;
	}

	public BeiJianDanWei(String id, String name, String code, String addTime,
						 String modifyTime, String deleteTime) {
		this.id = id;
		this.name = name;
		this.code = code;
		this.addTime = addTime;

		this.modifyTime = modifyTime;

		this.deleteTime = deleteTime;
	}

	public BeiJianDanWei() {
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public int getKind() {
		return kind;
	}

	public void setKind(int kind) {
		this.kind = kind;
	}

	public Double getLongitude() {
		return longitude;
	}

	public void setLongitude(Double longitude) {
		this.longitude = longitude;
	}

	public Double getLatitude() {
		return latitude;
	}

	public void setLatitude(Double latitude) {
		this.latitude = latitude;
	}

	public String getCategory() {
		return category;
	}

	public void setCategory(String category) {
		this.category = category;
	}

	public String getCharge() {
		return charge;
	}

	public void setCharge(String charge) {
		this.charge = charge;
	}

	public String getTel() {
		return tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public BeiJianDanWei(String id, String name, String code, String addTime,
						 String modifyTime, String deleteTime, String address, int kind,
						 Double longitude, Double latitude, String category, String charge,
						 String tel, String mobile) {
		this.id = id;
		this.name = name;
		this.code = code;
		this.addTime = addTime;
		this.modifyTime = modifyTime;
		this.deleteTime = deleteTime;
		this.address = address;
		this.kind = kind;
		this.longitude = longitude;
		this.latitude = latitude;
		this.category = category;
		this.charge = charge;
		this.tel = tel;
		this.mobile = mobile;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getKindStr() {
		Log.d("debug",kind+"");
		String kindStr = "";
		if (kind == 1) {
			kindStr = "企业";
		} else if (kind == 2) {
			kindStr = "合作社";

		} else if (kind == 3) {
			kindStr = "行业协会";
		} else if (kind == 4) {
			kindStr = "其他";
		} else if (kind == 7) {
			kindStr = "种养殖户";
		} else if (kind == 8) {
			kindStr = "投入品经营店";
		}
		else {
			kindStr = "";
		}

		return kindStr;
	}

	public String getCategoryStr() {

		String categoryStr = "";

		if (CharsetUtil.isNotNull(this.category)) {

			String[] categoryItemArr = this.category.split(",");

			StringBuffer sb = new StringBuffer();

			for (String categoryItem : categoryItemArr) {

				categoryItem = categoryItem.trim();

				if ("1".equals(categoryItem)) {
					sb.append("种植业");
				} else if ("2".equals(categoryItem)) {
					sb.append("畜牧业");
				} else if ("3".equals(categoryItem)) {
					sb.append("渔业");
				} else if ("4".equals(categoryItem)) {
					sb.append("其他");
				} else {
					sb.append("未知");
				}

				sb.append(",");
			}

			if (sb.length() > 0) {

				categoryStr = sb.substring(0, sb.length() - 1);
			} else {
				categoryStr = sb.toString();
			}

		} else {
			categoryStr = "未知";
		}

		return categoryStr;

	}

	public boolean isCreateShouJianDanWei() {
		return isCreateShouJianDanWei;
	}

	public void setCreateShouJianDanWei(boolean isCreateShouJianDanWei) {
		this.isCreateShouJianDanWei = isCreateShouJianDanWei;
	}

	public String getAddTime() {
		return addTime;
	}

	public void setAddTime(String addTime) {
		this.addTime = addTime;
	}

	public String getModifyTime() {
		return modifyTime;
	}

	public void setModifyTime(String modifyTime) {
		this.modifyTime = modifyTime;
	}

	public String getDeleteTime() {
		return deleteTime;
	}

	public void setDeleteTime(String deleteTime) {
		this.deleteTime = deleteTime;
	}

	public int getIsRedData() {
		return isRedData;
	}

	public void setIsRedData(int isRedData) {
		this.isRedData = isRedData;
	}

	public String getD() {
		return d;
	}

	public void setD(String d) {
		this.d = d;
	}

}
